package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbResume;
import rpd.model.TbResumeExample;
import rpd.model.TbResumeKey;
import rpd.model.TbResumeWithBLOBs;

public interface TbResumeMapper {
    long countByExample(TbResumeExample example);

    int deleteByExample(TbResumeExample example);

    @Delete({
        "delete from tb_resume",
        "where resume_id = #{resumeId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(TbResumeKey key);

    @Insert({
        "insert into tb_resume (resume_id, mobile_phone_num, ",
        "telephone_num, email, ",
        "sex_desc, sex_code, birthday, ",
        "household_register, address, ",
        "experience, desired_job_code, ",
        "desired_job_desc, desired_work_code, ",
        "desired_work_desc, desired_industry_code, ",
        "desired_industry_desc, desired_location_code, ",
        "desired_location_desc, desired_salay_code, ",
        "desired_salay_desc, current_status_code, ",
        "current_status_desc, self_evaluation, ",
        "educational_background, competence, ",
        "habit, language_ability_ref, ",
        "certificate, certificate_path, ",
        "picture, appendix_name, ",
        "appendix_path, other_info, ",
        "training_experience_ref, work_experience_ref, ",
        "project_experience_ref, study_situation_school_ref, ",
        "practical_experience_school_ref, is_delete, ",
        "name)",
        "values (#{resumeId,jdbcType=VARCHAR}, #{mobilePhoneNum,jdbcType=VARCHAR}, ",
        "#{telephoneNum,jdbcType=VARCHAR}, #{email,jdbcType=CHAR}, ",
        "#{sexDesc,jdbcType=CHAR}, #{sexCode,jdbcType=CHAR}, #{birthday,jdbcType=CHAR}, ",
        "#{householdRegister,jdbcType=CHAR}, #{address,jdbcType=CHAR}, ",
        "#{experience,jdbcType=INTEGER}, #{desiredJobCode,jdbcType=CHAR}, ",
        "#{desiredJobDesc,jdbcType=CHAR}, #{desiredWorkCode,jdbcType=CHAR}, ",
        "#{desiredWorkDesc,jdbcType=CHAR}, #{desiredIndustryCode,jdbcType=CHAR}, ",
        "#{desiredIndustryDesc,jdbcType=CHAR}, #{desiredLocationCode,jdbcType=CHAR}, ",
        "#{desiredLocationDesc,jdbcType=CHAR}, #{desiredSalayCode,jdbcType=CHAR}, ",
        "#{desiredSalayDesc,jdbcType=CHAR}, #{currentStatusCode,jdbcType=CHAR}, ",
        "#{currentStatusDesc,jdbcType=CHAR}, #{selfEvaluation,jdbcType=CHAR}, ",
        "#{educationalBackground,jdbcType=CHAR}, #{competence,jdbcType=CHAR}, ",
        "#{habit,jdbcType=CHAR}, #{languageAbilityRef,jdbcType=CHAR}, ",
        "#{certificate,jdbcType=CHAR}, #{certificatePath,jdbcType=CHAR}, ",
        "#{picture,jdbcType=CHAR}, #{appendixName,jdbcType=CHAR}, ",
        "#{appendixPath,jdbcType=CHAR}, #{otherInfo,jdbcType=CHAR}, ",
        "#{trainingExperienceRef,jdbcType=CHAR}, #{workExperienceRef,jdbcType=CHAR}, ",
        "#{projectExperienceRef,jdbcType=CHAR}, #{studySituationSchoolRef,jdbcType=CHAR}, ",
        "#{practicalExperienceSchoolRef,jdbcType=CHAR}, #{isDelete,jdbcType=CHAR}, ",
        "#{name,jdbcType=LONGVARCHAR})"
    })
    int insert(TbResumeWithBLOBs record);

    int insertSelective(TbResumeWithBLOBs record);

    List<TbResumeWithBLOBs> selectByExampleWithBLOBs(TbResumeExample example);

    List<TbResume> selectByExample(TbResumeExample example);

    @Select({
        "select",
        "resume_id, mobile_phone_num, telephone_num, email, sex_desc, sex_code, birthday, ",
        "household_register, address, experience, desired_job_code, desired_job_desc, ",
        "desired_work_code, desired_work_desc, desired_industry_code, desired_industry_desc, ",
        "desired_location_code, desired_location_desc, desired_salay_code, desired_salay_desc, ",
        "current_status_code, current_status_desc, self_evaluation, educational_background, ",
        "competence, habit, language_ability_ref, certificate, certificate_path, picture, ",
        "appendix_name, appendix_path, other_info, training_experience_ref, work_experience_ref, ",
        "project_experience_ref, study_situation_school_ref, practical_experience_school_ref, ",
        "is_delete, name",
        "from tb_resume",
        "where resume_id = #{resumeId,jdbcType=VARCHAR}"
    })
    @ResultMap("rpd.mapper.TbResumeMapper.ResultMapWithBLOBs")
    TbResumeWithBLOBs selectByPrimaryKey(TbResumeKey key);

    int updateByExampleSelective(@Param("record") TbResumeWithBLOBs record, @Param("example") TbResumeExample example);

    int updateByExampleWithBLOBs(@Param("record") TbResumeWithBLOBs record, @Param("example") TbResumeExample example);

    int updateByExample(@Param("record") TbResume record, @Param("example") TbResumeExample example);

    int updateByPrimaryKeySelective(TbResumeWithBLOBs record);

    @Update({
        "update tb_resume",
        "set mobile_phone_num = #{mobilePhoneNum,jdbcType=VARCHAR},",
          "telephone_num = #{telephoneNum,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=CHAR},",
          "sex_desc = #{sexDesc,jdbcType=CHAR},",
          "sex_code = #{sexCode,jdbcType=CHAR},",
          "birthday = #{birthday,jdbcType=CHAR},",
          "household_register = #{householdRegister,jdbcType=CHAR},",
          "address = #{address,jdbcType=CHAR},",
          "experience = #{experience,jdbcType=INTEGER},",
          "desired_job_code = #{desiredJobCode,jdbcType=CHAR},",
          "desired_job_desc = #{desiredJobDesc,jdbcType=CHAR},",
          "desired_work_code = #{desiredWorkCode,jdbcType=CHAR},",
          "desired_work_desc = #{desiredWorkDesc,jdbcType=CHAR},",
          "desired_industry_code = #{desiredIndustryCode,jdbcType=CHAR},",
          "desired_industry_desc = #{desiredIndustryDesc,jdbcType=CHAR},",
          "desired_location_code = #{desiredLocationCode,jdbcType=CHAR},",
          "desired_location_desc = #{desiredLocationDesc,jdbcType=CHAR},",
          "desired_salay_code = #{desiredSalayCode,jdbcType=CHAR},",
          "desired_salay_desc = #{desiredSalayDesc,jdbcType=CHAR},",
          "current_status_code = #{currentStatusCode,jdbcType=CHAR},",
          "current_status_desc = #{currentStatusDesc,jdbcType=CHAR},",
          "self_evaluation = #{selfEvaluation,jdbcType=CHAR},",
          "educational_background = #{educationalBackground,jdbcType=CHAR},",
          "competence = #{competence,jdbcType=CHAR},",
          "habit = #{habit,jdbcType=CHAR},",
          "language_ability_ref = #{languageAbilityRef,jdbcType=CHAR},",
          "certificate = #{certificate,jdbcType=CHAR},",
          "certificate_path = #{certificatePath,jdbcType=CHAR},",
          "picture = #{picture,jdbcType=CHAR},",
          "appendix_name = #{appendixName,jdbcType=CHAR},",
          "appendix_path = #{appendixPath,jdbcType=CHAR},",
          "other_info = #{otherInfo,jdbcType=CHAR},",
          "training_experience_ref = #{trainingExperienceRef,jdbcType=CHAR},",
          "work_experience_ref = #{workExperienceRef,jdbcType=CHAR},",
          "project_experience_ref = #{projectExperienceRef,jdbcType=CHAR},",
          "study_situation_school_ref = #{studySituationSchoolRef,jdbcType=CHAR},",
          "practical_experience_school_ref = #{practicalExperienceSchoolRef,jdbcType=CHAR},",
          "is_delete = #{isDelete,jdbcType=CHAR},",
          "name = #{name,jdbcType=LONGVARCHAR}",
        "where resume_id = #{resumeId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(TbResumeWithBLOBs record);

    @Update({
        "update tb_resume",
        "set mobile_phone_num = #{mobilePhoneNum,jdbcType=VARCHAR},",
          "telephone_num = #{telephoneNum,jdbcType=VARCHAR},",
          "email = #{email,jdbcType=CHAR},",
          "sex_desc = #{sexDesc,jdbcType=CHAR},",
          "sex_code = #{sexCode,jdbcType=CHAR},",
          "birthday = #{birthday,jdbcType=CHAR},",
          "household_register = #{householdRegister,jdbcType=CHAR},",
          "address = #{address,jdbcType=CHAR},",
          "experience = #{experience,jdbcType=INTEGER},",
          "desired_job_code = #{desiredJobCode,jdbcType=CHAR},",
          "desired_job_desc = #{desiredJobDesc,jdbcType=CHAR},",
          "desired_work_code = #{desiredWorkCode,jdbcType=CHAR},",
          "desired_work_desc = #{desiredWorkDesc,jdbcType=CHAR},",
          "desired_industry_code = #{desiredIndustryCode,jdbcType=CHAR},",
          "desired_industry_desc = #{desiredIndustryDesc,jdbcType=CHAR},",
          "desired_location_code = #{desiredLocationCode,jdbcType=CHAR},",
          "desired_location_desc = #{desiredLocationDesc,jdbcType=CHAR},",
          "desired_salay_code = #{desiredSalayCode,jdbcType=CHAR},",
          "desired_salay_desc = #{desiredSalayDesc,jdbcType=CHAR},",
          "current_status_code = #{currentStatusCode,jdbcType=CHAR},",
          "current_status_desc = #{currentStatusDesc,jdbcType=CHAR},",
          "self_evaluation = #{selfEvaluation,jdbcType=CHAR},",
          "educational_background = #{educationalBackground,jdbcType=CHAR},",
          "competence = #{competence,jdbcType=CHAR},",
          "habit = #{habit,jdbcType=CHAR},",
          "language_ability_ref = #{languageAbilityRef,jdbcType=CHAR},",
          "certificate = #{certificate,jdbcType=CHAR},",
          "certificate_path = #{certificatePath,jdbcType=CHAR},",
          "picture = #{picture,jdbcType=CHAR},",
          "appendix_name = #{appendixName,jdbcType=CHAR},",
          "appendix_path = #{appendixPath,jdbcType=CHAR},",
          "other_info = #{otherInfo,jdbcType=CHAR},",
          "training_experience_ref = #{trainingExperienceRef,jdbcType=CHAR},",
          "work_experience_ref = #{workExperienceRef,jdbcType=CHAR},",
          "project_experience_ref = #{projectExperienceRef,jdbcType=CHAR},",
          "study_situation_school_ref = #{studySituationSchoolRef,jdbcType=CHAR},",
          "practical_experience_school_ref = #{practicalExperienceSchoolRef,jdbcType=CHAR},",
          "is_delete = #{isDelete,jdbcType=CHAR}",
        "where resume_id = #{resumeId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(TbResume record);
}